//
//  DECXDescriptionViewController.m
//  DECXInStore
//
//  Created by 程强 on 15/12/25.
//  Copyright © 2015年 程强. All rights reserved.
//

#import "DECXDescriptionViewController.h"

@interface DECXDescriptionViewController ()<UIScrollViewDelegate>
@property (strong, nonatomic) UIImageView *descImage;
@end

@implementation DECXDescriptionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.scrollWidth.constant = ScreenWidth;
    
    self.descImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenWidth*578/360.0)];
    UIImage *image =LoadImage(@"desc");
    _descImage.image =image;
    [self.scrollView addSubview:_descImage];
    
    self.scrollHeight.constant =ScreenWidth*578/360.0;
    
    _scrollView.delegate=self;
    //设置最大伸缩比例
    _scrollView.maximumZoomScale=2.0;
    //设置最小伸缩比例
    _scrollView.minimumZoomScale=ScreenWidth/image.size.width;
    _scrollView.zoomScale =ScreenWidth/image.size.width;

    
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return self.descImage;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
